/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.udesc.db;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author anderson
 */
@Entity
@Table(name = "lancamentos_diarios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LancamentosDiarios.findAll", query = "SELECT l FROM LancamentosDiarios l"),
    @NamedQuery(name = "LancamentosDiarios.findById", query = "SELECT l FROM LancamentosDiarios l WHERE l.id = :id"),
    @NamedQuery(name = "LancamentosDiarios.findByData", query = "SELECT l FROM LancamentosDiarios l WHERE l.data = :data"),
    @NamedQuery(name = "LancamentosDiarios.findByTipoLancamento", query = "SELECT l FROM LancamentosDiarios l WHERE l.tipoLancamento = :tipoLancamento"),
    @NamedQuery(name = "LancamentosDiarios.findByValor", query = "SELECT l FROM LancamentosDiarios l WHERE l.valor = :valor"),
    @NamedQuery(name = "LancamentosDiarios.findByHistorico", query = "SELECT l FROM LancamentosDiarios l WHERE l.historico = :historico")})
public class LancamentosDiarios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    @Basic(optional = false)
    @NotNull
    @Column(name = "tipo_lancamento")
    private Character tipoLancamento;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "valor")
    private BigDecimal valor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "historico")
    private String historico;

    public LancamentosDiarios() {
    }

    public LancamentosDiarios(Integer id) {
        this.id = id;
    }

    public LancamentosDiarios(Integer id, Date data, Character tipoLancamento, BigDecimal valor, String historico) {
        this.id = id;
        this.data = data;
        this.tipoLancamento = tipoLancamento;
        this.valor = valor;
        this.historico = historico;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public Character getTipoLancamento() {
        return tipoLancamento;
    }

    public void setTipoLancamento(Character tipoLancamento) {
        this.tipoLancamento = tipoLancamento;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public String getHistorico() {
        return historico;
    }

    public void setHistorico(String historico) {
        this.historico = historico;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LancamentosDiarios)) {
            return false;
        }
        LancamentosDiarios other = (LancamentosDiarios) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.udesc.db.LancamentosDiarios[ id=" + id + " ]";
    }
    
}
